﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using DailyComics.Common.Model.Storage;

namespace DailyComics.Common.Model.ImageProvideStrategies
{
  public abstract class FallbackImageProviderStrategy : CachingImageProviderStrategy
  {
    public IImageProviderStrategy FallbackStrategy { get; private set; }

    public FallbackImageProviderStrategy()
      :this(null, new MemoryImageCache())
    { }

    public FallbackImageProviderStrategy(IImageProviderStrategy fallbackStrategy, IStorage storage)
      :base(storage)
    {
      FallbackStrategy = fallbackStrategy;
    }



    protected abstract void HandleFallbackResult(DateTime date, ImageSource result);
    protected abstract ImageSource HandleGetImage(DateTime date);
  }
}
